package cards;

import model.Board;
import model.Player;

public class Move extends GoTo {
	int distance;
	
	public Move(String text, int distance) {
		super(text);
		this.distance = distance;
	}

	@Override
	public void execute(Player player) {
		int position = player.getPosition() + this.distance;
		if(position < 1) position += 40;
		player.setPosition(position);
		Board.fields[position - 1].landOnField(player);
	}
}